<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html,
        body {
            height: 100%;
            width: 100%;
            padding: 0;
            margin: 0;
            background-color: #fff;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: rgba(255, 188, 112, .5);
        }

        #card {
            height: 400px;
            width: 250px;
            background-color: #f00;
            transform-style: preserve-3d;
            transform: perspective(1000px);
            transition: 1s;
        }

        #card:hover {
            margin-left: 250px;
        }

        #card:hover .card-img {
            transform: rotateY(-180deg);
        }

        #card .card-img {
            width: 100%;
            height: 100%;
            position: relative;
            transition: 0.5s;
            transform-style: preserve-3d;
            transform-origin: left;
            box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2);
            z-index: 100;
        }

        #card .card-img .img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-size: auto 120%;
            background-position: center center;
        }

        #card .card-img .img:nth-child(1) {
            background-image: url('./imgs/1.jpg');
        }
        #card .card-img .img:nth-child(2) {
            background-image: url('./imgs/2.jpg');
            transform: rotateY(180deg);
        }

        #card .card-body {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2);
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #card .card-body h1{
            writing-mode: vertical-lr;
            font-size: 80px;
            font-family: '077-上首苍穹书法体';
        }
    </style>
</head>

<body>
    <div id="card">
        <div class="card-img">
            <div class='img'></div>
            <div class='img'></div>
        </div>
        <div class="card-body">
            <h1>新春大吉</h1>
        </div>
    </div>
</body>

</html>